package com.cmict.data.infra.job.oa;

import com.cmict.data.framework.quartz.core.handler.JobHandler;
import com.cmict.data.framework.tenant.core.aop.TenantIgnore;
import com.cmict.data.framework.tenant.core.context.TenantContextHolder;
import com.cmict.data.system.api.oa.ScheduleManagementApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 定时通知 Job
 *
 * @author awesome
 */
@Component
@Slf4j
public class ScheduleManagementJob implements JobHandler {

    @Resource
    private ScheduleManagementApi scheduleManagementApi;

    @TenantIgnore
    @Override
    public String execute(String param){
        TenantContextHolder.setTenantId(Long.valueOf(1L));
        scheduleManagementApi.executeScheduleManagement();
        return String.format("日程通知结束！");
    }

}
